<?php

/**
 * AlertaCliente form.
 *
 * @package    cronos-doctrine
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class AlertaClienteForm extends BaseAlertaClienteForm
{
  public function configure()
  {
      
      
      unset (
        $this['created_at'],
        $this['updated_at']

      );
      
      $this->widgetSchema['empresa_id'] = new sfWidgetFormInputHidden(array(),array('value'=> sfContext::getInstance()->getUser()->getAttribute('agente_user_empresa_id')));
      $this->widgetSchema['usuario_id'] = new sfWidgetFormInputHidden();
      $this->widgetSchema['agente_id'] = new sfWidgetFormInputHidden();
      $this->widgetSchema['status'] = new sfWidgetFormInputHidden();
      
       $this->widgetSchema['fecha'] = new sfWidgetFormJQueryDate(array(
         'culture'=> 'es',         
         'config' => "{minDate: +1,}"         
         ));
      
      $this->widgetSchema['fecha'] = new sfWidgetFormInput(array(), array ('class' => 'dateTime','readonly'=>'true'));
      
      $this->widgetSchema['llamo_id'] = new sfWidgetFormDoctrineChoice(array(
         'multiple' => false, 
         'model' => 'sfGuardUser',
         'query' => Doctrine_Query::create()->select('u.id, u.first_name')->from('sfGuardUser u')->leftJoin('u.sfGuardUserPermission sf')->where('sf.permission_id =?',3)->addWhere('u.is_active = 1')->addWhere('u.empresa_id=?',sfContext::getInstance()->getUser()->getAttribute('agente_user_empresa_id')),
         'expanded' => false));
      
      $this->validatorSchema['llamo_id'] = new sfValidatorPass();
      
      $this->widgetSchema['nota'] = new sfWidgetFormTextarea();
      
  }
}
